package gdkm.wsz.dao;

import gdkm.wsz.pojo.Position;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;

public interface PositionDAO {
    @Select("select * from position where id=#{id}")
    public Position findById(Integer id);
    @Select("select * from position where name=#{name}")
    public Position findByName(String name);
    @Select("select * from position")
    public List< Position> findAll();
    @Insert("insert into position(name,description,level,created_time) values(#{name},#{description},#{level},#{created_time})")
    public boolean save(Position position);
    @Update("update position set name=#{name},description=#{description},level=#{level},created_time=#{created_time} where id=#{id}")
    public boolean update(Position position);
    @Delete("delete from position where id=#{id}")
    public boolean delete(Integer id);
}
